<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/html/js/axios.min.js"></script>
    <script src="/html/js/ajax.js"></script>
    <script src="/html/js/util.js"></script>
</head>
<script>
    async function login() {
        let params = {
            username: $("username").value,
            password: $("password").value
        }


        let result = await ajaxGet("/user/login", params);
        if (result == "ok") {
            location.href = "/html/index.html";
        } else {
            alert("你的账号密码有误请重新输入");
            $("username").value = "";
            $("password").value = "";
        }
    }
</script>

<body>
用户名 <input type="text" id="username">
用户密码 <input type="text" id="password">
<button onclick="login()">登录</button>
</body>
</html>